package com.path.planning.controller.path;


import com.deductive.common.core.domain.AjaxResult;
import com.path.planning.entity.path.NavigationQo;
import com.path.planning.service.impl.NavigationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;

/**
 * 路径规划
 */
@RestController
@RequestMapping("/navigation")
@Api(tags = "路径规划")
public class NavigationController {
    @Resource
    private NavigationService navigationService;

    /**
     * 公路规划
     *
     * @param navigationQo 请求参数 {@link NavigationQo}
     * @return {@link NavigationService#roadNavigation(NavigationQo)}
     */
    @PostMapping("/road")
    @ApiOperation("公路规划")
    public AjaxResult roadDesign(@RequestBody NavigationQo navigationQo) {
        return AjaxResult.success(navigationService.roadNavigation(navigationQo));
    }

    /**
     * 铁路规划
     *
     * @param navigationQo 请求参数 {@link NavigationQo}
     * @return {@link NavigationService#roadNavigation(NavigationQo)}
     */
    @PostMapping("/railway")
    @ApiOperation("铁路规划")
    public AjaxResult railwayDesign(@RequestBody NavigationQo navigationQo) {
        return AjaxResult.success(navigationService.railwayNavigation(navigationQo));
    }

    /**
     * 水路规划
     *
     * @param navigationQo 请求参数 {@link NavigationQo}
     * @return {@link NavigationService#roadNavigation(NavigationQo)}
     */
    @PostMapping("/waterway")
    @ApiOperation("水路规划")
    public AjaxResult waterwayDesign(@RequestBody NavigationQo navigationQo) {
        return AjaxResult.success(navigationService.waterwayNavigation(navigationQo));
    }

    /**
     * 公水联运
     *
     * @param navigationQo 请求参数 {@link NavigationQo}
     * @return {@link NavigationService#roadNavigation(NavigationQo)}
     */
    @PostMapping("/mix/road/waterway")
    @ApiOperation("公水联运")
    public AjaxResult roadWaterwayMixDesign(@RequestBody NavigationQo navigationQo) {
        return AjaxResult.success(navigationService.roadWaterwayMixDesign(navigationQo));
    }

    /**
     * 公铁联运
     *
     * @param navigationQo 请求参数 {@link NavigationQo}
     * @return {@link NavigationService#roadNavigation(NavigationQo)}
     */
    @PostMapping("/mix/road/railway")
    @ApiOperation("公铁联运")
    public AjaxResult roadRailwayMixDesign(@RequestBody NavigationQo navigationQo) {
        return AjaxResult.success(navigationService.roadRailwayMixDesign(navigationQo));
    }
}
